package huawei;
/*
* @Author: wanghongfucoder
* @Date:   2017-06-26 14:46:55
* @Last Modified by:   wanghongfucoder
* @Last Modified time: 2017-06-26 14:54:39
*/

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Scanner;
public class BrotherDit {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int count = sc.nextInt();
            String[] strs = new String[count];
            for (int i = 0; i < count; i ++){
                strs[i] = sc.next();
            }
            String brotherStr = sc.next();
            int index = sc.nextInt();
            ArrayList<String> list=new ArrayList<String>();
            int brotherWordNumber = 0;
            for (int i = 0; i < count; i ++){
                if(judgeBrotherWord(strs[i], brotherStr)){
                    //是兄弟单词
                    brotherWordNumber ++;
                    list.add(strs[i]);
                }
            }
            Collections.sort(list);//按照字典序列排序
            System.out.println(brotherWordNumber);
            if (index  <= list.size()){
                System.out.println(list.get(index-1));
            }
        }
        sc.close();
    }
 
     
    /**
     * 判断两个单词是否是兄弟单词(单词所含的字母完全相同，并且该单词不同)
     * @param source
     * 第一个单词
     * @param dest
     * 第二个单词
     * @return true：是兄弟单词，false：不是兄弟单词
     */
    public static boolean judgeBrotherWord(String source,String dest){
        if (source.equals(dest))
            return false;
        if (source.length() != dest.length())
            return false;
        char[] sCharArray = source.toCharArray();
        char[] dCharArray = dest.toCharArray();
        //两个单词不相等，判断其所含的字母是否相同（利用ascii码映射）
        int[] indexall = new int[26];
        for (int i = 0; i < sCharArray.length; i ++){
            indexall[(int)sCharArray[i] - 97]++;   
        }
        for (int i = 0; i < dCharArray.length; i ++){
            indexall[(int)dCharArray[i] - 97]--;   
        }
        for (int i = 0; i < indexall.length; i ++){
            if (indexall[i] != 0)
                return false;
        }
        return true;
    }
}